<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        button{
            width: 50px;
            height: 20px;   
            background-color: blue;
            color: white;    
            line-height: 20px;
            border: 1px solid black;
        }
        .one{
            background-color: red;
        }
       
    </style>
</head>
<body>
    <div id="app" >
        <button v-if='time>0' class="one">{{time}}</button>
        <button v-if='time==0' >进入</button>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        var app=new Vue({
            el:"#app",
            data:{
                time:5
            },
            mounted(){
               setInterval(()=>{
                   if(this.time>0){
                       this.time=this.time-1
                   }
               },1000)
            }
        })
    </script>
</body>
</html>